/**
 */
package org.autosar.schema.r4.impl;

import java.util.Collection;

import org.autosar.schema.r4.DATAELEMENTSTYPE;
import org.autosar.schema.r4.DATAELEMENTTYPE;
import org.autosar.schema.r4.R4Package;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>DATAELEMENTSTYPE</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * </p>
 * <ul>
 *   <li>{@link org.autosar.schema.r4.impl.DATAELEMENTSTYPEImpl#getDATAELEMENT <em>DATAELEMENT</em>}</li>
 * </ul>
 *
 * @generated
 */
public class DATAELEMENTSTYPEImpl extends MinimalEObjectImpl.Container implements DATAELEMENTSTYPE {
	/**
	 * The cached value of the '{@link #getDATAELEMENT() <em>DATAELEMENT</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDATAELEMENT()
	 * @generated
	 * @ordered
	 */
	protected EList<DATAELEMENTTYPE> dATAELEMENT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected DATAELEMENTSTYPEImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return R4Package.Literals.DATAELEMENTSTYPE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<DATAELEMENTTYPE> getDATAELEMENT() {
		if (dATAELEMENT == null) {
			dATAELEMENT = new EObjectContainmentEList<DATAELEMENTTYPE>(DATAELEMENTTYPE.class, this, R4Package.DATAELEMENTSTYPE__DATAELEMENT);
		}
		return dATAELEMENT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case R4Package.DATAELEMENTSTYPE__DATAELEMENT:
				return ((InternalEList<?>)getDATAELEMENT()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case R4Package.DATAELEMENTSTYPE__DATAELEMENT:
				return getDATAELEMENT();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case R4Package.DATAELEMENTSTYPE__DATAELEMENT:
				getDATAELEMENT().clear();
				getDATAELEMENT().addAll((Collection<? extends DATAELEMENTTYPE>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case R4Package.DATAELEMENTSTYPE__DATAELEMENT:
				getDATAELEMENT().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case R4Package.DATAELEMENTSTYPE__DATAELEMENT:
				return dATAELEMENT != null && !dATAELEMENT.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //DATAELEMENTSTYPEImpl
